home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-09-17 | 31.7 KB | 1,029 lines |
- ; $VER: Vahunz-Tschak 1.1 (17.9.98)
- ;
- ; Copyright 1998 Thomas Aglassinger. All rights reserved.
- ;
- ; A case tool to create a script that runs Vahunz. The user can select a
- ; basic mode for vahunzation. The file list is generated automatically
- ; and the dignorary can be selected. On request, Vahunz can create the
- ; dictionary and the editor is launched immediately after creation.
- ;
- ; Additionally you can create or update dignoraries with it.
-
- ; TODO: cleanup temporary files
- ; TODO: use "java.ignore" as default if vahunzing Java sources
- ; TODO: make a more clear interface flow by first offering to vahunz
- ; source code or create a dignorary
-
- ; Specify minimum installer version
-
- (debug "set version")
- (set #minimum-installer-version 43)
- (set #minimum-installer-revision 3)
- (set #minimum-installer-id
- (+ #minimum-installer-revision
- (* #minimum-installer-version 65536)
- )
- )
- (debug " minimum-installer-id = " #minimum-installer-id)
- (debug " current-installer-id = " @installer-version)
-
-
- ; Filename for the CLI script to be created. Later on the the source
- ; directory is inserted at the beginning of this name.
- (set #file-vahunz-it "Vahunz it!")
-
- ; Texts for messages, prompts and help
-
- (
- (set #message-welcome
- (cat "Welcome to Vahunz-Tschak, the script generator for Vahunz.\n"
- ))
-
- (set #message-wrong-installer
- (cat "You have an old version of the program 'Installer' on your Amiga!\n\n"
- "The installation procedure needs at least Installer "
- #minimum-installer-version "." #minimum-installer-revision ".\n\n"
- "Please obtain a newer version!\n\n"
- "(Check Aminet or "
- "the WWW site of the current owner of the rights for Amiga.)"
- ))
-
- (set #message-wrong-list
- (cat "This script requires the standard 'c:list' command to be installed.\n\n"
- "It seems you are using some incompatible replacement."
- ))
-
- (set #message-overview
- (cat "Vahunz-Tschak is a frontend for Vahunz to spare you fiddling with "
- "command line options.\n\n"
- "It asks you some questions concerning "
- "the location of your source code and options for vahunz. After that "
- "it creates a CLI-script \"" #file-vahunz-it "\" you can invoke at "
- "any time to perform the vahunzation.\n\n"
- "If you are unsure about the meaning of a question, click the \"Help\" "
- "button or take a look at the manual."
- ))
-
- ; Choices for basic vahunz mode
- (set #choice-vahunz-standard "Standard")
- (set #choice-vahunz-exchange "Exchange")
- (set #choice-vahunz-rename "The Great Renaming")
- (set #choice-vahunz-custom "Custom")
- (set #choice-create-c "Create C/C++ dignorary")
- (set #choice-create-java "Create Java dignorary")
-
-
-
- (set #prompt-vahunz-mode "Select the kind of vahunzation you want to perform:")
- (set #help-vahunz-mode
- (cat "This specifies what vahunz should do with your sources.\n\n"
- #choice-vahunz-standard " - Perform a standard vahunzation mostly using "
- "default options. This gives you a reasonably unreadable source code "
- "without comments and indention you can use to distribute to normal "
- "users who only want to compile it and nothing else."
- "\n\n"
- #choice-vahunz-exchange " - Works like \"" #choice-vahunz-standard "\", "
- "but preserves line numbers in the vahunzed source. This gives accurate "
- "line numbers referring to your original source if users report source "
- "code related errors like problems during compilation."
- "\n\n"
- #choice-vahunz-rename " - Does not remove any data from your original "
- "code but only creates a dictionary prepared for "
- "\"The Great Renaming\"."
- "\n\n"
- #choice-vahunz-custom " - Asks you all options to be specified manually. "
- "This is useful for maximum control over the vahunzation."
- "\n\n"
- #choice-create-c " - Lets you specify your include directory and creates "
- "a dignorary from it."
- "\n\n"
- #choice-create-java " - Lets you specify your Javadoc directory and "
- "creates a dignorary from it."
- ))
-
- ; Choices for source type
- (set #choice-source-c "C/C++")
- (set #choice-source-java "Java")
-
- (set #prompt-source-type
- "Select the type of source codes that should be vahunzed:"
- )
- (set #help-source-type
- (cat "The source type decides for which file pattern the source directory is "
- "scanned."
- ))
-
- (set #prompt-source-directory
- (cat "Select source directory to scan for source codes and where the support "
- "files for vahunz will be stored:"
- ))
- (set #help-source-directory
- (cat "The directory you selected and all its sub-directories are scanned for "
- "source codes to be vahunzed.\n\n"
- "Support files like \"vahunz.files\" and the dictionaries are also "
- "stored there. This includes the \"" #file-vahunz-it "\" CLI-script "
- "created by Vahunz-Tschak at the end."
- ))
- (set #prompt-source-pattern
- "Enter pattern for source file to be vahunzed:"
- )
- (set #help-source-pattern
- (cat "Here you can specify a AmigaDOS pattern the files in the source "
- "directory have to match to be considered for vahunzation."
- "\n\n"
- "For example, #?.(c|h) specifies all C sources and headers."
- "\n\n"
- "All sub-directories within the source directory are also scanned."
- ))
-
- (set #prompt-dignorary
- "Select default dignorary to be used by vahunz:"
- )
- (set #help-dignorary
- (cat "The dignorary is a special dictionary containing names you know that "
- "you don't want them to vahunz already beforehand. It usually "
- "contains names of functions and constants of standard and system "
- "libraries.\n\n"
- "If you do not want to use a dignorary, choose \"empty.ignore\"."
- ))
-
- (set #prompt-custom-switches "Select the switches you want to enable")
- (set #help-custom-switches
- (cat "Here you can enable switches that will influence the output Vahunz "
- "creates."
- ))
-
- (set #message-create-vahunz-files-1
- "Creating \""
- )
- (set #message-create-vahunz-files-2
- "\" using the following command:"
- )
- (set #help-create-vahunz-files
- (cat "This command creates the \"vahunz.files\" containing all source files "
- "vahunz should take into account."
- ))
-
- (set #message-create-vahunz-ignore-1
- "Creating \""
- )
- (set #message-create-vahunz-ignore-2
- "\" using the following command:"
- )
- (set #help-create-vahunz-ignore
- (cat "This command creates dignorary \"vahunz.ignore\" containig all names "
- "to be ignored."
- ))
-
- (set #prompt-create-vahunz-it
- (cat "Writing \"" #file-vahunz-it "\""
- ))
- (set #help-vahunz-it
- (cat "\"" #file-vahunz-it "\" is the CLI-script created by Vahunz-Tschak "
- "that actually performs the vahunzation. "
- "\n\n"
- "You can call it whenever you updated your original source code and "
- "want to create a new vahunzed version."
- ))
-
- (set #prompt-target-directory
- (cat "Select target directory where the vahunzed source code should be "
- "stored:"
- ))
- (set #help-target-directory
- (cat "To preserve your original source code, the vahunzed one is written "
- "to a different directory, but with the same filenames."
- "\n\n"
- "This usually allows you to use the same scripts and Makefile for "
- "compilation as for the original."
- ))
-
- (set #work-create-script "Creating script")
- (set #work-copy-dignorary "Copying dignorary from")
-
- (set #prompt-launch-vahunz
- (cat "The script has been created. To also create the dictionary it has to be "
- "executed.\n\n"
- "Do you want me to start the script now?"
- ))
- (set #help-launch-vahunz
- (cat "You can execute the script now to make vahunz extract all names of your "
- "source code and create the dictionary.\n\n"
- "If you do not want to do that right now, you can skip this part and "
- "execute the script later from Workbench or CLI."
- ))
-
- (set #status-vahunzing
- (cat "Vahunzing...\n\n"
- "(This can take a while)"
- ))
-
- (set #prompt-editor
- (cat "The dictionary has been created.\n\n"
- "You should load it into your editor and modify the lines you want to "
- "vahunz/rename."
- ))
- (set #help-editor
- (cat "Your editor according to the environment variable EDITOR will be "
- "started and load the dictionary.\n\n"
- "Mark words you want to vahunz with plus (+) and those you want to "
- "ignore with minus (-).\n\n"
- "To rename a name, leave the first character blank and specify the "
- "new name after an equal sign (=), for example:\n\n"
- "\" rdcfg=read_settings\""
- ))
-
- (set #message-exit
- (cat "A CLI-script has been created in \"%s\"."
- "\n\n"
- "You can perform the vahunzation by executing this script from CLI "
- "or by double-clicking it from the Workbench."
- "\n\n"
- "As the script automatically goes to the source directory and also "
- "restores the current directory upon exit, you can safely invoke it "
- "from other scripts, Makefiles or similar."
- "\n\n"
- "Happy Vahunzing!"
- ))
- )
-
- (set #prompt-include-directory "Select C/C++ include directory")
- (set #help-include-directory
- (cat "The include directory contains all your header files with names you want "
- "to ignore when vahunzing source codes."
- ))
-
- (set #working-list-include-files "Creating include file list")
- (set #working-scan-include-files "Scanning include files")
- (set #working-translate-dignorary "Replacing blanks by hyphens")
- (set #working-cleanup-dignorary "Cleaning up dignorary")
-
- (set #prompt-javadoc-directory "Select include directory")
- (set #help-javadoc-directory
- (cat "The include directory contains your system header files."
- "\n\n"
- "They usually contain variables, prototypes and macros you do not "
- "want to vahunz."
- ))
-
- (set #prompt-javadoc-directory "Select Javadoc directory")
- (set #help-javadoc-directory
- (cat "The Javadoc directory contains the API documentation in HTML format. All "
- "documents matching the file pattern \"[a-z]-index.html\" in this "
- "directory are scanned for references."
- "\n\n"
- "That means, a file named \"a-index.html\" has to exist in the directory "
- "you select, otherwise it will be rejected."
- ))
- (set #message-bad-javadoc-directory
- (cat "The directory selected does not contain a file named \"a-index.html\". "
- "Therefor this is not considered to be a directory containing API "
- "documentation in JavaDoc format."
- "\n\n"
- "Select a proper directory next time."
- ))
-
- (set #working-scan-javadoc "Scanning \"%s\"")
- (set #working-cleanup-javadoc "Cleaning temporary dignorary using vahunz")
-
- (set #prompt-target-dignorary "Specify target dignorary to create")
- (set #help-target-dignorary
- (cat "Specify directory and filename of the target directory."
- "\n\n"
- "Preferably, it should be stored in the standard dignorary directory "
- "and should have the suffix \".ignore\"."
- ))
-
- (set #message-exit-dignorary
- (cat "The new dignorary has been stored in \"%s\"."
- "\n\n"
- "It is ready for your next vahunzation."
- ))
- ;----------------------------------------------------------------------------
- ; Run a command and check for a certain return code
- ;----------------------------------------------------------------------------
- (procedure P-run #name #expected-result #command
- (
- (debug " name = " #name)
- (debug " expt = " #expected-result)
- (debug " comd = " #command)
-
- (set #real-result (run #command))
- (if (<> #expected-result #real-result)
- (
- (abort #name " returned " #real-result " instead of "
- #expected-result ":\n\n"
- #command)
- )
- )
- ))
-
- ;----------------------------------------------------------------------------
- ; Execute a script and check for a certain return code
- ;----------------------------------------------------------------------------
- (procedure P-execute #name #expected-result #command
- (
- (debug " name = " #name)
- (debug " expt = " #expected-result)
- (debug " comd = " #command)
-
- (set #real-result (execute #command))
- (if (<> #expected-result #real-result)
- (
- (abort #name " returned " #real-result " instead of "
- #expected-result ":\n\n"
- #command)
- )
- )
- ))
-
- ;----------------------------------------------------------------------------
- ; Load certain file into editor
- ;----------------------------------------------------------------------------
- (procedure P-edit #file #prompt #help
- (
- ; Get editor from $EDITOR or use c:Ed
-
- (set #editor (getenv "editor"))
- (if (= "" #editor) ((set #editor "c:Ed")))
-
- (debug "editor = " #editor)
-
- ; Run editor
-
- (set #command-editor (cat #editor " \"" #file "\""))
- (run #command-editor
- (prompt #prompt)
- (help #help)
- (confirm "average")
- )
- ))
-
- ;----------------------------------------------------------------------------
- ; Check requirements
- ;----------------------------------------------------------------------------
-
- ; Check installer version to piss people off and make them
- ; download a new one or dump the whole filetype (He he he).
- ; (The script should work with older versions, but how am I
- ; supposed to test this?)
-
- (procedure P-check-requirements
- (debug "check version")
- (if (< @installer-version #minimum-installer-id)
- (
- (debug "installer too old")
- (abort #message-wrong-installer)
- )
- )
-
- (debug "check list")
- (if (run "list >nil: lformat=%p%n all pat=#?")
- (
- (debug "no/wrong list")
- (abort #message-wrong-list)
- )
- ))
-
- ;----------------------------------------------------------------------------
- ; Welcome user
- ;----------------------------------------------------------------------------
-
- (procedure P-welcome
- (debug "welcome")
- (welcome #message-welcome)
-
- (message #message-overview)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask for basic vahunz mode
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-vahunz-mode
- (debug "ask vahunz mode")
-
- (set #vahunz-mode
- (askchoice
- (choices
- #choice-vahunz-standard
- #choice-vahunz-exchange
- #choice-vahunz-rename
- #choice-vahunz-custom
- #choice-create-c
- #choice-create-java
- )
- (prompt #prompt-vahunz-mode)
- (help #help-vahunz-mode)
- )
- )
- (debug "vahunz-mode = " #vahunz-mode)
-
- (select #vahunz-mode
-
- ; Standard
- (set #vahunz-options "")
-
- ; Exchange
- (set #vahunz-options "--line --random-seed=1 --store")
-
- ; The Great Renaming
- (set #vahunz-options "--comment --indent --line --no-unused")
-
- ; Custom
- (set #vahunz-options "*custom*")
-
- ; Create C dignorary
- (set #vahunz-options "*create-c*")
-
- ; Create C dignorary
- (set #vahunz-options "*create-java*")
-
- )
- (debug "vahunz-options = " #vahunz-options)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask for source type
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-source-type
- (debug "ask source type")
-
- (set #source-type
- (askchoice
- (choices
- #choice-source-c
- #choice-source-java
- )
- (prompt #prompt-source-type)
- (help #help-source-type)
- )
- )
- (debug "source-type = " #source-type)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask for source directory
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-source-directory
- (debug "ask source directory")
-
- (if (= @app-name "debug")
- (
- set #source-directory "prog:SmartReadArgs"
- )
- (
- (set #source-directory
- (askdir
- (prompt #prompt-source-directory)
- (help #help-source-directory)
- (default "Work:")
- ))
- )
- ) ;if
-
- (debug "source directory = " #source-directory)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask for source pattern
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-source-pattern
- (debug "choose source pattern")
-
- (select #source-type
-
- ; C/C++
- (set #source-pattern "#?.(c|h|c++|cxx|cpp|cc)")
-
- ; Java
- (set #source-pattern "#?.(java|jav)")
-
- ; Others (currently disabled)
- (
- (set #source-pattern
- (askstring
- (prompt #prompt-source-pattern)
- (help #help-source-pattern)
- (default "#?.(c|h|c++|cxx|cpp|cc)")
- ))
- )
- )
-
- (debug "source pattern = " #source-pattern)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask for dignorary
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-dignorary
- (debug "ask dignorary")
-
- (set #dignorary
- (askfile
- (prompt #prompt-dignorary)
- (help #help-dignorary)
- (default "dignorary/amiga.ignore")
- ))
-
- (debug "dignorary = " #dignorary)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask for target directory
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-target-directory
- (debug "ask target directory")
-
- (set #target-directory
- (askdir
- (prompt #prompt-target-directory)
- (help #help-target-directory)
- (default "ram:")
- ))
-
- (debug "dignorary = " #target-directory)
- )
-
- ;----------------------------------------------------------------------------
- ; Ask options in case of vahunz mode set to "Custom"
- ;----------------------------------------------------------------------------
- (procedure P-ask-custom-switches
- (if (= #vahunz-options "*custom*")
- (
- ; Ask for switches
-
- (set #options
- (askoptions
- (prompt #prompt-custom-switches)
- (help #help-custom-switches)
- (default 0)
- (choices
- "Preserve comments (--comment)"
- "Preserve indention (--indent)"
- "Preserve line numbers (--line)"
- "Remove unused names from dictionary (--no-unused)"
- "Store vahunzed names in dictionary (--store)"
- "Suppress warning messages (--no-warning)"
- )
- ))
- (set #vahunz-options "")
- (if (IN #options 0) (set #vahunz-options (cat #vahunz-options " --comment")))
- (if (IN #options 1) (set #vahunz-options (cat #vahunz-options " --indent")))
- (if (IN #options 2) (set #vahunz-options (cat #vahunz-options " --line")))
- (if (IN #options 3) (set #vahunz-options (cat #vahunz-options " --no-unused")))
- (if (IN #options 4) (set #vahunz-options (cat #vahunz-options " --store")))
- (if (IN #options 5) (set #vahunz-options (cat #vahunz-options " --no-warning")))
- )
- )
- )
-
- ;----------------------------------------------------------------------------
- ; Create "vahunz.files"
- ;----------------------------------------------------------------------------
-
- (procedure P-create-vahunz.files
- (set #vahunz-files (tackon #source-directory "vahunz.files"))
- (set #file-command-list "t:vahunz-tschack-list.tmp")
-
- (working "Creating \"" #vahunz-files "\"")
-
- (set #command-sequence-list
- (cat "cd \"" #source-directory "\"\n"
- "list lformat=%p%n all "
- "pat=\"" #source-pattern "\" "
- ">\"" #vahunz-files "\"\n"
- ))
-
- (debug "command: " #command-sequence-list)
-
- (textfile
- (dest #file-command-list)
- (append #command-sequence-list)
- )
-
- (P-execute "#file-command-list" 0 #file-command-list)
- )
-
- ;----------------------------------------------------------------------------
- ; Create "vahunz.ignore"
- ;----------------------------------------------------------------------------
-
- (procedure P-create-vahunz.ignore
- (set #vahunz-ignore (tackon #source-directory "vahunz.ignore"))
-
- (set #command-copy-dignorary
- (cat "copy quiet clone "
- "from=\"" #dignorary "\" "
- "to=\"" #vahunz-ignore "\""
- ))
-
- (debug "command: " #command-copy-dignorary)
-
- (working #work-copy-dignorary " \"" #vahunz-ignore "\"")
-
- (P-run "#command-copy-dignorary" 0 #command-copy-dignorary)
- )
-
- ;----------------------------------------------------------------------------
- ; Create "Vahunz it!"
- ;----------------------------------------------------------------------------
-
- (procedure P-create-vahunz-it
- (set #vahunz-it (tackon #source-directory #file-vahunz-it))
- (set #vahunz-it-icon (cat #vahunz-it ".info"))
-
- (working #work-create-script " \"" #vahunz-it "\"")
-
- (set #command-vahunz-it
- (cat "assign vahunz-cd-<$$>: \"\"\n"
- "cd \"" #source-directory "\"\n"
- (expandpath "vahunz")
- " " #vahunz-options
- " \"--output=" #target-directory "\" "
- "\n"
- "cd vahunz-cd-<$$>:\n"
- "assign vahunz-cd-<$$>: remove\n"
- ))
-
- (debug "vahunz-it contents:\n---\n"
- #command-vahunz-it
- "---")
-
- (textfile
- (prompt #promp-create-vahunz-it)
- (help #help-vahunz-it)
- (dest #vahunz-it)
- (append #command-vahunz-it)
- )
-
- (set #command-copy-icon
- (cat "copy quiet clone "
- "from=tschak/def_vahunz.info "
- "to=\"" #vahunz-it-icon "\""
- ))
-
- (P-run "#command-copy-icon" 0 #command-copy-icon)
-
- ; Set "S" protection bit of "Vahunz it!"
- (set #command-protect-vahunz-it
- (cat "protect \"" #vahunz-it "\" +s"
- ))
-
- (P-run "#command-protect-vahunz-it" 0 #command-protect-vahunz-it)
- )
-
- ;----------------------------------------------------------------------------
- ; Invoke "Vahunz it!"
- ;----------------------------------------------------------------------------
-
- (procedure P-invoke-vahunt-it
- (set #vahunz-launched
- (askbool
- (prompt #prompt-launch-vahunz)
- (help #help-launch-vahunz)
- (default 1)
- ))
-
- (debug "launch vahunz = " #vahunz-launched)
-
- (if #vahunz-launched
- (
- (working #status-vahunzing)
- (P-run "#vahunz-it" 0 (cat "execute \"" #vahunz-it "\""))
-
- ; We can't use P-execute here because it does not quote the name
- )
- )
- )
-
- ;----------------------------------------------------------------------------
- ; Edit "vahunz.names"
- ;----------------------------------------------------------------------------
-
- (procedure P-edit-vahunz.names
- (set #vahunz-names (tackon #source-directory "vahunz.names"))
- (if #vahunz-launched (P-edit #vahunz-names #prompt-editor #help-editor))
- )
-
- ;----------------------------------------------------------------------------
- ; Exit message
- ;----------------------------------------------------------------------------
-
- (procedure P-exit
- (exit
- (#message-exit #vahunz-it)
- (quiet)
- ))
-
- ;----------------------------------------------------------------------------
- ; Ask for include directory
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-include-directory
- (
- (debug "ask include directory")
-
- (set #include-directory
- (askdir
- (prompt #prompt-include-directory)
- (help #help-include-directory)
- (default "include:")
- ))
- ))
-
- ;----------------------------------------------------------------------------
- ; Create include file list
- ;----------------------------------------------------------------------------
-
- (procedure P-create-include-files
- (
- (debug "list include files")
-
- (working #working-list-include-files)
-
- (set #command-list-include
- (cat "list >ram:temporary.files lformat=%p%n all pat=#?.h "
- #include-directory
- ))
-
- (P-run "#command-list-include" 0 #command-list-include)
- ))
-
- ;----------------------------------------------------------------------------
- ; Scan include file
- ;----------------------------------------------------------------------------
-
- (procedure P-scan-include-files
- (
- (debug "scan include files")
-
- (working #working-scan-include-files)
-
- (delete "ram:temporary.names" (optional "force"))
- (delete "ram:temporary.ignore" (optional "force"))
-
- (set #command-scan-include "vahunz --base-name ram:temporary")
-
- (P-run "#command-scan-include" 0 #command-scan-include)
- ))
-
- ;----------------------------------------------------------------------------
- ; Translate and append include dignorary
- ;----------------------------------------------------------------------------
-
- (procedure P-translate-dignorary
- (
- (debug "translate dignorary")
-
- (working #working-translate-dignorary)
-
- (set #command-translate-dignorary
- (cat "tschak/blank-to-hyphen"
- " <ram:temporary.names"
- " >>ram:temporary.ignore"
- ))
-
- (P-run "#command-translate-dignorary" 0 #command-translate-dignorary)
-
- ; Delete the name list and launch vahunz again to sort the whole mess
- ; and kick out possible duplicates
- (debug "cleanup dignorary")
-
- (working #working-cleanup-dignorary)
- (delete "ram:temporary.names" (optional "force"))
-
- (set #command-cleanup-dignorary "vahunz --base-name ram:temporary")
- (P-run "#command-cleanup-dignorary" 0 #command-cleanup-dignorary)
- ))
-
-
-
- ;----------------------------------------------------------------------------
- ; Ask for target dignorary name
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-target-dignorary #name
- (
- (debug "ask target dignorary")
-
- (set #target-dignorary
- (askfile
- (prompt #prompt-target-dignorary)
- (help #help-target-dignorary)
- (default (tackon "dignorary" #name))
- ))
-
- (debug "target dignorary = " #target-dignorary)
- ))
-
- ;----------------------------------------------------------------------------
- ; Move temporary dignorary to standard dignorary directory
- ;----------------------------------------------------------------------------
- (procedure P-move-dignorary #source-dignorary
- (
- (debug "move dignorary")
- (debug " source = \"" #source-dignorary "\"")
- (debug " target = \"" #target-dignorary "\"")
-
- (copyfiles
- (source #source-dignorary)
- (dest (pathonly #target-dignorary))
- (newname (fileonly #target-dignorary))
- (optional "askuser")
- )
-
- (delete
- #source-dignorary
- (optional "force")
- )
- ))
-
-
- ;----------------------------------------------------------------------------
- ; Ask for JavaDoc directory
- ;----------------------------------------------------------------------------
-
- (procedure P-ask-javadoc-directory
- (
- (debug "ask javadoc directory")
-
- (set #javadoc-exists 0)
-
- (set #javadoc-directory
- (askdir
- (prompt #prompt-javadoc-directory)
- (help #help-javadoc-directory)
- (default "jdk:1.1/docs/api")
- ))
-
- ; Check, if "a-index.html" exists in this directory
- (set #javadoc-exist (exists (tackon #javadoc-directory "a-index.html")))
-
- (debug "#javadoc-exist = " #javadoc-exist)
-
- ; If not, annoy user
- (if (= 0 #javadoc-exist) (abort #message-bad-javadoc-directory))
- ))
-
- ;----------------------------------------------------------------------------
- ; Scan JavaDoc index file and append references to dignorary
- ;----------------------------------------------------------------------------
- (procedure P-scan-javadoc #filename #complete2
- (
- ; Compute name of index file to scan
- (set #javadoc-filename (tackon #javadoc-directory #filename))
-
- (debug "scan " #javadoc-filename)
-
- (complete #complete2)
- (working (#working-scan-javadoc #javadoc-filename))
-
- ; Compute command to scan
- (set #command-scan-javadoc
- (cat "sys:rexxc/rx tschak/scan-javadoc.rexx \"" #javadoc-filename "\" \"ram:java.ignore\""
- ))
-
- (P-run "#command-scan-javadoc" 0 #command-scan-javadoc)
- ))
-
-
- ;----------------------------------------------------------------------------
- ; Scan JavaDoc directory and create dignorary from it
- ;----------------------------------------------------------------------------
- (procedure P-scan-javadoc-directory #complete
- (
- (debug "scan javadoc directory")
-
- (set #script-cleanup-dignorary "t:cleanup-dignorary")
-
- ; Setup temporary files
- (P-run "#command-reset-scan" 0 "echo \"\" >ram:java.ignore noline")
- (P-run "#command-reset-scan" 0 "echo \"\" >ram:dummy.java")
- (P-run "#command-reset-scan" 0 "echo \"dummy.java\" >ram:java.files")
- (delete "ram:java.names")
-
- (P-scan-javadoc "a-index.html" (+ #complete 1))
- (P-scan-javadoc "b-index.html" (+ #complete 2))
- (P-scan-javadoc "c-index.html" (+ #complete 3))
- (P-scan-javadoc "d-index.html" (+ #complete 4))
- (P-scan-javadoc "e-index.html" (+ #complete 5))
- (P-scan-javadoc "f-index.html" (+ #complete 6))
- (P-scan-javadoc "g-index.html" (+ #complete 7))
- (P-scan-javadoc "h-index.html" (+ #complete 8))
- (P-scan-javadoc "i-index.html" (+ #complete 9))
- (P-scan-javadoc "j-index.html" (+ #complete 10))
- (P-scan-javadoc "k-index.html" (+ #complete 11))
- (P-scan-javadoc "l-index.html" (+ #complete 12))
- (P-scan-javadoc "m-index.html" (+ #complete 13))
- (P-scan-javadoc "n-index.html" (+ #complete 14))
- (P-scan-javadoc "o-index.html" (+ #complete 15))
- (P-scan-javadoc "p-index.html" (+ #complete 16))
- (P-scan-javadoc "q-index.html" (+ #complete 17))
- (P-scan-javadoc "r-index.html" (+ #complete 18))
- (P-scan-javadoc "s-index.html" (+ #complete 19))
- (P-scan-javadoc "t-index.html" (+ #complete 20))
- (P-scan-javadoc "u-index.html" (+ #complete 21))
- (P-scan-javadoc "v-index.html" (+ #complete 22))
- (P-scan-javadoc "w-index.html" (+ #complete 23))
- (P-scan-javadoc "x-index.html" (+ #complete 24))
- (P-scan-javadoc "y-index.html" (+ #complete 25))
- (P-scan-javadoc "z-index.html" (+ #complete 26))
-
- (complete (+ #complete 30))
- (working #working-cleanup-javadoc)
-
- (set #command-cleanup-dignorary
- (cat "cd ram:\n"
- (expandpath "vahunz") " --base-name java --no-warning --quiet\n"
- ))
-
- (textfile
- (dest #script-cleanup-dignorary)
- (append #command-cleanup-dignorary)
- )
-
- (P-execute "#script-cleanup-dignorary" 0 #script-cleanup-dignorary)
-
- (debug "cleanup temporary files")
-
- (set #command-cleanup
- (cat "delete >nil: quiet force"
- " ram:java.names"
- " ram:java.files"
- " ram:dummy.java"
- ))
-
- (run #command-cleanup)
- ))
-
- ;----------------------------------------------------------------------------
- ; Exit message for created dignoraries
- ;----------------------------------------------------------------------------
-
- (procedure P-exit-dignorary
- (exit
- (#message-exit-dignorary #target-dignorary)
- (quiet)
- ))
-
- ;----------------------------------------------------------------------------
- ; "Wollt ihr das totale Programm?"
- ;----------------------------------------------------------------------------
-
- (complete 0) (P-check-requirements)
- (complete 5) (P-welcome)
-
- (complete 10) (P-ask-vahunz-mode)
-
- (set #flow-selector 0)
- (if (= #vahunz-options "*create-c*") (set #flow-selector 1))
- (if (= #vahunz-options "*create-java*") (set #flow-selector 2))
-
- (select #flow-selector
- (
- ; Vahunz source code
- (complete 20) (P-ask-custom-switches)
- (complete 25) ; (P-ask-custom-name-length)
- (complete 30) ; (P-ask-custom-prefix)
- (complete 35) ; (P-ask-custom-random-seed)
- (complete 40) ; (P-ask-custom-vahunz-length)
- (complete 45) (P-ask-source-type)
- (complete 50) (P-ask-source-directory)
- (complete 55) (P-ask-source-pattern)
- (complete 60) (P-ask-dignorary)
- (complete 65) (P-ask-target-directory)
-
- (complete 75) (P-create-vahunz.files)
- (complete 80) (P-create-vahunz.ignore)
- (complete 85) (P-create-vahunz-it)
- (complete 90) (P-invoke-vahunt-it)
- (complete 95) (P-edit-vahunz.names)
- (complete 100) (P-exit)
- )
- (
- ; Create C/C++ dignorary
- (complete 30) (P-ask-include-directory)
- (complete 50) (P-ask-target-dignorary "amiga.ignore")
- (complete 70) (P-create-include-files)
- (complete 80) (P-scan-include-files)
- (complete 90) (P-translate-dignorary)
- (complete 95) (P-move-dignorary "ram:temporary.ignore")
- (complete 100) (P-exit-dignorary)
- )
- (
- ; Create Java dignorary
- (complete 30) (P-ask-javadoc-directory)
- (complete 50) (P-ask-target-dignorary "java.ignore")
- (complete 60) (P-scan-javadoc-directory 60)
- (complete 95) (P-move-dignorary "ram:java.ignore")
- (complete 100) (P-exit-dignorary)
- )
- )
-
-